/*
CUNY - GMapper
Software Design Lab
CSC 22100 - Spring 2011

TEAM 9:
Ariel Teferici
Ivan Tse
Michael Cheong

SVN Repository:
http://code.google.com/p/cuny-gmapper/
 */
package com.macavelly.com;

import java.io.IOException;
import java.util.List;
import java.util.Locale;

import com.google.android.maps.GeoPoint;
import com.google.android.maps.MapView;
import com.google.android.maps.Overlay;
import com.google.android.maps.OverlayItem;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.graphics.drawable.Drawable;
import android.location.Address;
import android.location.Geocoder;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TabHost;
import android.widget.TextView;


public class HomeActivity extends Activity {

	private EditText peaddy; 
	private Button btnReverseGeocode;
	private TextView tvStat; 



	public void onCreate(Bundle savedInstanceState) {
		
		super.onCreate(savedInstanceState);
		setContentView(R.layout.home);
		peaddy = (EditText) findViewById(R.id.peaddy);
		tvStat = (TextView) findViewById(R.id.textViewStat);
		AddressInfo.addy = "160 Convent Avenue, New York, NY 10031";

		
		
		btnReverseGeocode = (Button) findViewById(R.id.btnReverseGeocode);
		btnReverseGeocode.setOnClickListener(
				new OnClickListener() {
					public void onClick(View v)
					{					
						if (peaddy.getText().toString().trim().equals("")){
						 tvStat.setText("Please Enter An Address!");
						}
						else{
						AddressInfo.addy = peaddy.getText().toString();
						tvStat.setText("");
						TabHost tabHost =  (TabHost) getParent().findViewById(android.R.id.tabhost);
						tabHost.setCurrentTab(1);
						}


						
					}
				}
		);
		
		
		
	}
	
	
}


